<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 86158
  Date: 2022/2/26
  Time: 22:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>CoolMeeting会议管理系统</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/styles/common.css"/>
    <style type="text/css">

    </style>
</head>
<body>
<div class="page-header">
    <div class="header-banner">
        <img src="${pageContext.request.contextPath}/images/header.png" alt="CoolMeeting"/>
    </div>
    <div class="header-title">
        欢迎访问Cool-Meeting会议管理系统
    </div>
    <div class="header-quicklink">
        欢迎您，<strong>${sessionScope.currentuser.employeename}</strong>
        <a href="${pageContext.request.contextPath}/changepassword">[修改密码]</a>
    </div>
</div>
<div class="page-body">
    <div class="page-sidebar">
        <div class="sidebar-menugroup">
            <jsp:include page="leftMenu.jsp" flush="true"></jsp:include>
        </div>
    </div>
    <div class="page-content">
        <div class="content-nav">
            会议预定 > 搜索会议
        </div>
        <form action="${pageContext.request.contextPath}/searchmeetings">
            <fieldset>
                <legend>搜索会议</legend>
                <table class="formtable">
                    <tr>
                        <td>会议名称：</td>
                        <td>
                            <input value="${meeting.meetingname}" name="meetingname" type="text" id="meetingname" maxlength="20"/>
                        </td>
                        <td>会议室名称：</td>
                        <td>
                            <input value="${roomname}" name="roomname" type="text" id="roomname" maxlength="20"/>
                        </td>
                        <td>预定者姓名：</td>
                        <td>
                            <input value="${employeename}" name="employeename" type="text" id="reservername" maxlength="20"/>
                        </td>
                    </tr>
                    <tr>
                        <td>预定日期：</td>
                        <td colspan="5">
                            从&nbsp;<input type="date" id="reservefromdate" placeholder="例如：2013-10-20"/>
                            到&nbsp;<input type="date" id="reservetodate" placeholder="例如：2013-10-22"/>
                        </td>
                    </tr>
                    <tr>
                        <td>会议日期：</td>
                        <td colspan="5">
                            从&nbsp;<input type="date" id="meetingfromdate" placeholder="例如：2013-10-20"/>
                            到&nbsp;<input type="date" id="meetingtodate" placeholder="例如：2013-10-22"/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6" class="command">
                            <input type="submit" class="clickbutton" value="查询"/>
                            <input type="reset" class="clickbutton" value="重置"/>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </form>
        <div>
            <h3 style="text-align:center;color:black">查询结果</h3>
            <div class="pager-header">
                <div class="header-info">
                    共<span class="info-number">${total}</span>条结果，
                    分成<span class="info-number">${pagenum}</span>页显示，
                    当前第<span class="info-number">${page}</span>页
                </div>
                <div class="header-nav">
                    <input type="button" class="clickbutton" onclick="window.location='${pageContext.request.contextPath}/searchmeetings?roomname=${roomname}&meetingname=${meeting.meetingname}&employeename=${employeename}&page=1'" value="首页"/>
                    <input type="button" class="clickbutton" onclick="window.location='${pageContext.request.contextPath}/searchmeetings?roomname=${roomname}&meetingname=${meeting.meetingname}&employeename=${employeename}&page=${page-1}'" value="上页"/>
                    <input type="button" class="clickbutton" onclick="window.location='${pageContext.request.contextPath}/searchmeetings?roomname=${roomname}&meetingname=${meeting.meetingname}&employeename=${employeename}&page=${page+1}'" value="下页"/>
                    <input type="button" class="clickbutton" onclick="window.location='${pageContext.request.contextPath}/searchmeetings?roomname=${roomname}&meetingname=${meeting.meetingname}&employeename=${employeename}&page=${pagenum}'" value="末页"/>
                    <form action="${pageContext.request.contextPath}/searchmeetings" method="post">
                        跳到第<input name="page" type="text" id="pagenum" class="nav-number"/>页
                        <input type="hidden" name="roomname" value="${roomname}">
                        <input type="hidden" name="meetingname" value="${meeting.meetingname}">
                        <input type="hidden" name="employeename" value="${employeename}">
                        <input type="submit" class="clickbutton" value="跳转"/>
                    </form>
                </div>
            </div>
        </div>
        <table class="listtable">
            <tr class="listheader">
                <th>会议名称</th>
                <th>会议室名称</th>
                <th>会议开始时间</th>
                <th>会议结束时间</th>
                <th>会议预定时间</th>
                <th>预定者</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${mts}" var="mt">
                <tr>
                    <td>${mt.meetingname}</td>
                    <td>${mt.meetingRoom.roomname}</td>
                    <td><fmt:formatDate value="${mt.starttime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <td><fmt:formatDate value="${mt.endtime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <td><fmt:formatDate value="${mt.reservationtime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <td>${mt.employee.employeename}</td>
                    <td>
                        <a class="clickbutton" href="${pageContext.request.contextPath}/meetingdetails/${mt.meetingid}">查看详情</a>
                    </td>
                </tr>
            </c:forEach>

        </table>
    </div>
</div>
<div class="page-footer">
    <hr/>
    更多问题，欢迎联系<a href="mailto:webmaster@eeg.com">管理员</a>
    <img src="${pageContext.request.contextPath}/images/footer.png" alt="CoolMeeting"/>
</div>
</body>
</html>
